1. Field of the Invention
The present invention relates generally to a nonvolatile semiconductor memory device, and more particularly to a nonvolatile semiconductor memory device with a data protection function.
2. Description of the Related Art
In some cases, a nonvolatile semiconductor memory device is used in the state in which the memory area thereof is divided into an instruction code storage area that stores instruction codes of a microcontroller, a CPU, etc., and a user data storage area. In this device, the user data storage area is an area where all of a data write operation, an erase operation and a read operation are executable in accordance with a user's request.
Assume that the nonvolatile semiconductor memory device is mounted, for instance, in a mobile phone and instruction codes are written in the instruction code storage area of the nonvolatile semiconductor memory device at the stage of manufacture. In such a case, in general, setting for prohibiting data write/erase is made in the nonvolatile semiconductor memory device. This prevents the user to change the stored instruction codes. Thereby, even if the nonvolatile memory device goes into an unexpected state due to, e.g. a crash of the CPU, the instruction code storage area is protected and rewrite or erasure of instruction codes can be prevented. In the field of ordinary flash memories, this function is called “write protect” or “protect”.
In order to realize the protect function, the following technique, for instance, is adopted. Information on the instruction code storage area is stored in a nonvolatile ROM. The CPU refers to the information in the nonvolatile ROM, and prohibits, e.g. rewrite in the instruction code storage area.
In the meantime, data rewrite in the nonvolatile ROM is also executed by a command that is controlled by the CPU. This requires provision of means for prohibiting data write/erase in the protect ROM due to an unexpected CPU operation. In usual cases, as regards devices that are mass-produced in factories, etc., protect information is written by a ROM writer, etc. in a nonvolatile ROM that is yet to be mounted on the nonvolatile semiconductor memory device. At this stage, the instruction code storage area is set in the protect state, and only a read-out operation is enabled.
The write of the protect information is realized in the following manner. For example, a predetermined command is input while a voltage (e.g. 12 V) that is higher than a power supply voltage, with which the nonvolatile ROM, when mounted on the nonvolatile semiconductor memory device, operates, is being applied to a predetermined input pin (e.g. reset signal /RESET). Rewrite, etc. in the nonvolatile ROM cannot be effected by other methods.
The nonvolatile ROM, in which the protect information is written, is mounted on, e.g. a printed circuit board by means of soldering. In usual cases, this printed circuit board, on which the nonvolatile ROM is mounted, has no means for applying a high voltage that is necessary for rewrite/erasure in the nonvolatile ROM. Only a voltage that is as high as a power supply voltage (e.g. 3.3 V) can be input to each pin. Thus, the fact that a high voltage cannot be applied after the nonvolatile ROM is mounted on the printed circuit board is the actual means for prohibiting rewrite, etc. in the nonvolatile ROM.
However, with the development in functions of mobile phones, etc. in recent years, there are cases where the nonvolatile ROM needs to be updated due to, e.g. defects in instruction codes of the CPU after the nonvolatile ROM is mounted on the printed circuit board. In addition, there is a demand that rewrite be made in the nonvolatile ROM due to, e.g. an improvement in software after factory shipment. In other words, it becomes necessary to execute write/erasure in the nonvolatile ROM without application of high voltages. To achieve this, it is thinkable to use a so-called password unlock function. According to this function, write/erasure in the nonvolatile ROM is permitted only when plural-bit password data, which is prestored in a one-time program area prior to factory shipment and cannot be erased by users, coincides with password data that is input from outside.
In order to realize the password unlock function, it is necessary to newly provide the nonvolatile semiconductor memory device with a one-time program area that is not erasable by a user and is different from a memory cell array; a control circuit for reading out password data that is prestored in the one-time program area, when a predetermined command is input; a sense amplifier for sensing the read-out data; a data register that stores, within the chip, password data with a predetermined number of bits, which is input following the input of the predetermined command; and a determination circuit that determines coincidence/noncoincidence between the read-out data and the input data. This leads to a problem of an increase in chip area of the nonvolatile semiconductor memory device.
Other related art discloses that a password unlock function is executed by additionally providing circuits for detecting the order of input of password data and the coincidence of password data (see Jpn. Pat. Appln. KOKAI Publication No. 2003-132688).